﻿namespace DataChangeTools.WebApi.IRepository
{
    /// <summary>
    /// 接口抽象类
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IBasicsRepository
    {
        /// <summary>
        /// 分页查
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        dynamic? GetPageList(int index, int size);

        /// <summary>
        /// 列表查
        /// </summary>
        /// <returns></returns>
        dynamic? GetList();

        /// <summary>
        /// 多条件查
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        dynamic? GetListByParam(Dictionary<bool, Dictionary<string, string>>? param);

        /// <summary>
        /// 根据id查询
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        dynamic? GetListById(int id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool Add(dynamic? entity);

        /// <summary>
        /// 批增
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool AddList(dynamic? entityList);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool Delete(int id);

        /// <summary>
        /// 批删
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool Deletes(dynamic[]? ids);

        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        bool Edit(dynamic? entity);
    }
}
